package org.yn.subject.infra.basic.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.yn.subject.infra.basic.entity.SubjectMapping;
import org.yn.subject.infra.basic.mapper.SubjectMappingDao;
import org.yn.subject.infra.basic.service.SubjectMappingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 题目分类关系表(SubjectMapping)表服务实现类
 *
 * @author makejava
 * @since 2024-03-12 20:13:59
 */
@Service("subjectMappingService")
public class SubjectMappingServiceImpl extends
    ServiceImpl<SubjectMappingDao, SubjectMapping> implements SubjectMappingService {

  @Autowired
  private SubjectMappingDao subjectMappingDao;

  @Override
  public List<SubjectMapping> queryMappingByCategoryId(Long categoryId) {
    QueryWrapper<SubjectMapping> queryWrapper = new QueryWrapper<>();
    queryWrapper.eq("category_id",categoryId).
        eq("is_deleted",0);
    return subjectMappingDao.selectList(queryWrapper);
  }
}

